<!doctype html>
<html lang="en">
	<head>
		<!-- Required meta tags -->
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
		<!-- Bootstrap CSS -->
		<link rel="stylesheet" href="/css/bootstrap.min.css">
		<title>media list</title>
	</head>
  
	<body>
		<h1 class="text-center pt-3 pb-3">修改图书</h1>
		
		<div class="container">
			<hr>
			<form action="/update_book?bookId=${book.bookId}" method="post">
				<div class="form-group row">
					<h4 class="offset-md-3 col-md-2 text-right">图书名称：</h4>
					<div class="col-md-4">
						<input type="text" class="form-control" name="bookName" value="${book.bookName}" placeholder="">
					</div>
				</div>
				<div class="form-group row">
					<h4 class="offset-md-3 col-md-2 text-right">出&nbsp;&nbsp;版&nbsp;&nbsp;社：</h4>
					<div class="col-md-4">
						<select class="form-control" name="publisher.publisherId">
							<#list publisherList as p>
                                <option value="${p.publisherId}" ${(p.publisherId==book.publisher.publisherId)?string("selected","")}>
									${p.publisherName}
								</option>
							</#list>
						</select>
					</div>
				</div>
				<div class="form-group row">
					<h4 class="offset-md-3 col-md-2 text-right">图书分类：</h4>
					<div class="col-md-4 row" style="font-size:16px; font-weight:lighter;">
						<#list categoryList as c>
							<div class="col-md-4">
                                <input type="checkbox" name="categoryId" value="${c.categoryId}" ${(book.categoryList?seq_contains(c))?string("checked","")}> ${c.categoryName}
                            </div>
						</#list>
					</div>
				</div>
				<div class="offset-md-5 col-md-4 text-left">
					<button type="submit" class="btn btn-primary">修改图书</button>
					<button type="button" class="btn btn-outline-primary">关闭窗口</button>
				</div>
			</form>
		</div>
	</body>
</html>
